#include "widget.h"
#include "ui_widget.h"

Widget::Widget(QWidget *parent)
    : QWidget(parent)
    , ui(new Ui::Widget)
{
    ui->setupUi(this);
    timer_id1=startTimer(1000);
    timer_id2=startTimer(2000);
    timer_id3=startTimer(1000);
}

Widget::~Widget()
{
    delete ui;
}

void Widget::timerEvent(QTimerEvent *e)
{
    if(e->timerId()==timer_id1){
        static int num1=1;
        ui->l1->setText(QString::number(num1++));
    }
    if(e->timerId()==timer_id2){
        static int num2=1;
        ui->l2->setText(QString::number(num2++));
    }
    if(e->timerId()==timer_id3){
        static int num3=1;
        ui->lcdNumber->display(QString::number(num3++));
    }
}

